<!--_meta 作为公共模版分离出去-->
<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->

<title>添加管理员 - 管理员管理</title>
<meta name="keywords" content="汽车租赁">
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<article class="page-container">
	<form class="form form-horizontal" id="form-admin-add" >
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>中文名称：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="" placeholder="中文名称" id="permisname" name="permisname">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>资源代码：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="" placeholder="资源代码" id="permiscode" name="permiscode">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>资源编号：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="" placeholder="资源编号" id="permisid" name="permisid">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">资源类型：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<select class="permistype" bgcolor="#FFF" name="permistype" id="permistype">
				<option value="1">一级目录</option>
				<option value="2">二级目录</option>
				<option value="3">按钮</option>				
			</select>			
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>相对路径：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="" placeholder="相对路径" id="relateurl" name="relateurl">
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>上级编号：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="" placeholder="上级编号" id="parentid" name="parentid">
		</div>
	</div>
		<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">上级目录：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="" placeholder="上级目录" id="parentids" name="parentids">
		</div>
	</div>	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">是否启用：</label>
		<div class="formControls col-xs-8 col-sm-9 skin-minimal">
			<div class="radio-box">
				<input name="isabled" type="radio" id="us_1" value="1" checked>
				<label for="sex-1">正常</label>
			</div>
			<div class="radio-box">
				<input type="radio" id="us_0" name="isabled" value="0">
				<label for="sex-2">禁用</label>
			</div>
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">添加时间：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<input type="text" class="input-text" autocomplete="off" value="" placeholder="添加时间" id="addtime" name="daddtime">
		</div>
	</div>	
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">选择权限：</label>
		<div class="formControls col-xs-8 col-sm-9" style="width:300px;border-style:solid;border-color:#000;">
			<input type="checkbox" class="input-checkbox" value="1">查询<br/>
			<input type="checkbox" class="input-checkbox" value="2">删除<br/>
			<input type="checkbox" class="input-checkbox" value="3">修改<br/>
			<input type="checkbox" class="input-checkbox" value="4">增加<br/>
			
		</div>
	</div>
	<div class="row cl">
		<label class="form-label col-xs-4 col-sm-3">备注：</label>
		<div class="formControls col-xs-8 col-sm-9">
			<textarea id="remark" name="remark" cols="" rows="" class="textarea"  placeholder="说点什么...100个字符以内" dragonfly="true" onKeyUp="textarealength(this,100)"></textarea>
			<p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
		</div>
	</div>	
	<div class="row cl">
		<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			<input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" onclick="$('#form-admin-add').submit()"/>
		</div>
	</div>
	</form>
</article>

<!--_footer 作为公共模版分离出去--> 
<#include "include/_footer.html">
<!--/_footer /作为公共模版分离出去--> 
<script type="text/javascript" src="lib/webuploader/0.1.5/webuploader.min.js"></script> 

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript">
$(function(){


	var uploader = WebUploader.create({
		auto: true,
		swf: 'lib/webuploader/0.1.5/Uploader.swf',
		server: '/uploadFile',
		pick: '#filePicker',
		fileVal:'uploadfile',
		resize: false,
		accept: {
			title: 'Images',
			extensions: 'gif,jpg,jpeg,bmp,png',
			mimeTypes: 'image/*'
		}
	});


	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-admin-add").validate({	
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			
	   		$.ajax({
	            type: 'post', 
				contentType:"application/json", 
	            url: '/saveResourceAdd', 
	            data:JSON.stringify({
						'permisid': $("#permisid").val()+'',
						'permisname': $("#permisname").val(),
		                'permiscode':$("#permiscode").val(),
						'permistype':$("#permistype").val(),
						'relateurl': $("#relateurl").val(),
		                'parentid': $("#parentid").val(),
		                'parentids': $("#parentids").val(),
		                'isabled':$("#isabled").val(),
						'addtime':$("#addtime").val(),						
						}),
	            success:function(data){ 
	 				console.log('提交成功！');
	 				var index = parent.layer.getFrameIndex(window.name);
					parent.$("#searchUsers").click();
					parent.layer.close(index);
	            }
	
	        });

			
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>